﻿using Microsoft.Phone.Controls;

namespace Budgetsch.WP7
{
    using System.Windows.Navigation;

    using Budgetsch.WP7.ViewModel.Income;
    using Budgetsch.WP7.ViewModel.Public;

    using GalaSoft.MvvmLight.Ioc;

    /// <summary>
    /// Description for PublicView.
    /// </summary>
    public partial class PublicView : PhoneApplicationPage
    {
        /// <summary>
        /// Initializes a new instance of the PublicView class.
        /// </summary>
        public PublicView()
        {
            InitializeComponent();
            var vm = SimpleIoc.Default.GetInstance<PublicViewModel>();
            vm.GetPublicUsers();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            listBox.SelectedIndex = -1;
        }

        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            base.OnNavigatedFrom(e);
            listBox.SelectedIndex = -1;
        }
    }
}